package com.drug.mingkang.service.impl;

import com.drug.mingkang.model.HqDatadic;
import com.drug.mingkang.mapper.HqDatadicMapper;
import com.drug.mingkang.model.HqRawmaterialType;
import com.drug.mingkang.service.HqDatadicService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;

/**
 * 数据字典(HqDatadic)表服务实现类
 *
 * @author 陆林
 * @since 2020-08-11 12:00:12
 */
@Service("hqDatadicService")
public class HqDatadicServiceImpl implements HqDatadicService {
    @Resource
    private HqDatadicMapper hqDatadicMapper;

    /**
     * 通过ID查询单条数据
     *
     * @param dicId 主键
     * @return 实例对象
     */
    @Override
    public HqDatadic queryById(String dicId) {
        return this.hqDatadicMapper.queryById(dicId);
    }

    /**
     * 查询多条数据
     *
     * @param datadic
     * @return 对象列表
     */
    @Override
    public List<HqDatadic> queryAllByLimit(HqDatadic datadic) {
        return this.hqDatadicMapper.queryAllByLimit(datadic);
    }

    /**
     * 新增数据
     *
     * @param hqDatadic 实例对象
     * @return 实例对象
     */
    @Override
    public int insert(HqDatadic hqDatadic) {
        int rows = this.hqDatadicMapper.insert(hqDatadic);
        return rows;
    }

    /**
     * 修改数据
     *
     * @param hqDatadic 实例对象
     * @return 实例对象
     */
    @Override
    public int update(HqDatadic hqDatadic) {
       int rows =  this.hqDatadicMapper.update(hqDatadic);
       return rows;
    }

    /**
     * 通过主键删除数据
     *
     * @param dicId 主键
     * @return 是否成功
     */
    @Override
    public int deleteById(String dicId) {
        int rows =  this.hqDatadicMapper.deleteById(dicId) ;
        return rows;
    }

    @Override
    public List<HqDatadic> queryAll(HqDatadic hqDatadic) {
        return this.hqDatadicMapper.queryAll(hqDatadic);
    }


}